Skip to content

Remove from string column#19790

Open
ishanema03 wants to merge 7 commits intoapache:mainfrom
ishanema03:remove-from-string-column
Open

Remove from string column#19790
ishanema03 wants to merge 7 commits intoapache:mainfrom
ishanema03:remove-from-string-column

Conversation

@ishanema03
Copy link

Which issue does this PR close?

Rationale for this change

As mentioned in the issue, the From trait implementations for Column were misleading - they invoked Column::from_qualified_name() which parses and lower-cases field names, making conversions like field.name().into() behave unexpectedly. Requiring explicit calls to Column::from_qualified_name() makes the behavior clear and prevents misuse.

What changes are included in this PR?

  • Removed From, From<&str>, and From<&String> trait implementations for Column
  • Updated col() and unnest() functions to accept strings directly
  • Replaced all .into() usages with explicit Column::from_qualified_name() calls across the codebase

Are these changes tested?

Yes, all existing tests have been updated and pass with the new API.

Are there any user-facing changes?

Yes, this is a breaking API change:

  • Users must now call Column::from_qualified_name() explicitly instead of using .into()
  • The helper functions col() and unnest() still accept strings directly

@github-actions github-actions bot added sql SQL Planner logical-expr Logical plan and expressions optimizer Optimizer rules core Core DataFusion crate substrait Changes to the substrait crate common Related to common crate labels Jan 13, 2026
@ishanema03 ishanema03 marked this pull request as draft January 13, 2026 12:31
@ishanema03 ishanema03 force-pushed the remove-from-string-column branch from 97d3400 to 56a14c5 Compare January 13, 2026 12:45
@ishanema03 ishanema03 marked this pull request as ready for review January 13, 2026 12:52
@findepi findepi requested a review from alamb February 18, 2026 16:17
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ishanema03

I think this is a non trivial breaking API (as you can see by the number of API changes)

I understand the rationale for trying to make the API easier to use, but I think we need to balance that against the need to avoid breaking downstream users who are already using the APIs

Can someone help me understand if there is some particular bug this is solving?

I think some of the nuance on API change guidelines isn't well documented, so I'll make a PR to update it https://datafusion.apache.org/contributor-guide/api-health.html

@alamb
Copy link
Contributor

alamb commented Feb 26, 2026

I wrote up some thoughts here

github-merge-queue bot pushed a commit that referenced this pull request Feb 28, 2026
## Which issue does this PR close?


## Rationale for this change

DataFusion does make API changes from time to time, and that is a normal
part of software development. However, it is important to evaluate the
impact of those API changes on downstream users and to ensure that the
benefits of the change are clear to those users.

I found a few times where API changes were made with the justification
that "some APIs in DataFusion are cleaner" or "this is more consistent
with other APIs". While those may be valid justifications, it is painful
for downstream users who have change their code to accommodate the API
change when they get nothing in return

This most recently happened in this PR
-
#19790 (review)

thus I think the contributor guide should include some guidance on how
to evaluate breaking API changes and to ensure that the benefits of the
change are clear to downstream users.


## What changes are included in this PR?

Polish up the API guidance section

## Are these changes tested?

By CI

## Are there any user-facing changes?

Better / clearer docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules sql SQL Planner substrait Changes to the substrait crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove From<String> for Column

2 participants